<template>
    <div>
        <van-field label='手机号' v-model="mobile"/>
        <van-field label='验证码' v-model="code"/>
        <van-button @click="send">发送验证码</van-button>
        <van-button @click="login">登录</van-button>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            mobile:'',
            code:'',
        }
    },
    methods: {
        send(){
            this.axios.post('sendSms',{'mobile':this.mobile}).then(res=>{
                alert(res.data.mes)
            })
        },
        login(){
            this.axios.post('tlogin',{'mobile':this.mobile,'code':this.code}).then(res=>{
                alert(res.data.mes)
            })
    },
    created() {

    }
}
}
</script>

<style scoped>

</style>